1. Field of the Invention
This invention relates generally to computer systems, and more particularly to methods and computer readable media for writing and reading to and from a compact disc (CD) media.
2. Description of the Related Art
In recent years, compact disc (CD) recording technology has made substantial advancements that have enabled casual computer users to digitally record digitally all types of data to the CD media. As is well known, there are several types of CD media recording standards and associated media. Two commonly used CD media recording standards include a compact disc recordable (CD-R) standard and a compact disc rewritable (CD-RW) standard. Using the CD-R standard, users are able to record data onto a CD-R disc only one time. This is because the data that is digitally written to the CD-R causes a permanent change in the properties of the CD-R. This change in property is often referred to as the xe2x80x9cburningxe2x80x9d of data onto the CD.
On the other hand, CD-RW technology allows rewriting of data previously stored onto the CD media. CD-RW, unlike CD-R, performs recording by making use of phase change materials in its recording layer. When that phase change material is irradiated by a laser beam, the data can be erased (crystal phase) and recorded (amorphous phase). Then, by way of differences in the reflectivity of either the crystal phase or amorphous phase, the data stored on the media can be read. This therefore enables repeated erasing and recording of data to the same CD media. CD media recorded using the CD-RW technology is typically not readable by standard CD-ROM drives. To do this, a program called MultiRead is required to be installed on the computer. This is different that CD media recorded using CD-R technology, which is readable by standard CD-ROM drives.
As is well known to those skilled in the art, data written using CD-RW and CD-R technology uses a standard called Universal Disk Format (UDF) to accomplish the writing. Writing data in accordance with the UDF standard provides great flexibility in terms of transferring data between a CD media and other storage devices, such as hard disks and floppy disks. Unfortunately, when a file is to be written, the file system will often times not provide the entire file in sequential order or at the same time. For instance, the first part of the file to be written can, in many cases be data associated with the middle or end of a file.
In order to facilitate reading of files from the CD media, software algorithms are commonly used to arrange the data being received from the file system in a correct order before writing to the CD media is commenced. A problem with this arranging technique is that the software algorithms can become quite complex. In addition to complexity, the CPU is also called upon to perform additional processing, which has the down side of slowing down writing operations to CD media.
In view of the foregoing, there is a need for computer implemented methods to enable writing of files to a CD media in the order the file data is received from the file system. This can significantly reduce writing complexity and pre-writing processing.
Broadly speaking, the present invention fills these needs by providing methods and computer readable media for writing file data to a CD media in the order received. Reading is then facilitated using map data that enables reconstruction of the data into proper file order. It should be appreciated that the present invention can be implemented in numerous ways, including as a process, an apparatus, a system, computer readable media, or a device. Several inventive embodiments of the present invention are described below.
In one embodiment, a method for writing a file of data to a compact disc media is disclosed. The method begins by receiving a first portion of the file for writing to the compact disc media. Once received, the first portion is divided into a plurality of chunks. A map data sector is then generated for a set of the plurality of chunks, and the map data sector includes information for interrelating the file data and the plurality of chunks to be written to the compact disc media. The map data sector is then written to the compact disc media followed by the plurality of chunks of the first portion of the file. If possible, the plurality of chunks are first compressed before writing them to the compact disc media. In this embodiment, the compact disc media can either be a CD-RW media or a CD-R media.
If the first portion is long enough to fill multiple sets of chunks, associated map data sectors will be generated for those additional sets of chunks. In one embodiment, each map data sector can include multiple sets of map data. Reading of a file written to the compact disc media will include reading the map data for the file, decompressing the file if needed and then arranging the chunks of data in accordance with information provided by the map data. The file is then transferred to the requesting application in the arranged file order.
In another embodiment, a method for writing file data to a rewritable compact disc media is disclosed. The method includes: (a) receiving the file data in an out-of-order sequence for writing to the rewritable compact disc media; (b) receiving a first portion of the file data; (c) dividing the first portion of the file data into a plurality of chunks; (d) generating a plurality of map data sectors, such that one map data sector is associated with a set of the plurality of chunks, and the plurality of chunks include one or more sets of the plurality of chunks; (e) writing the plurality of map data sectors to the rewritable compact disc media beginning at a zero file offset; and (f) writing the plurality of chunks of the first portion of the file data to the rewritable compact disc media at a location that is logically after the plurality of map data sectors.
In still a further embodiment, computer readable media having program instructions for writing file data to a rewritable compact disc media is disclosed. The operations of the computer readable media include program instructions for: (a) receiving the file data in an out-of-order sequence for writing to the rewritable compact disc media; (b) receiving a first portion of the file data; (c) dividing the first portion of the file data into a plurality of chunks; (d) generating a plurality of map data sectors, such that one map data sector is associated with a set of the plurality of chunks, and the plurality of chunks include one or more sets of the plurality of chunks; (e) writing the plurality of map data sectors to the rewritable compact disc media beginning at a zero file offset; and (f) writing the plurality of chunks of the first portion of the file data to the rewritable compact disc media at a location that is logically after the plurality of map data sectors.
Advantageously, data written to a compact disc media can now be written in the order it is received, even if the order is not in the proper sequential file order. The generated map data is then used to enable reading of the file data from the compact disc media and arranging the file data into proper file order before transferring the file to a requesting application. As such, writing of data to a compact disc can be done more quickly and with less complicated pre-writing arranging algorithms which slow down systems and introduce significant programming complexity. Other aspects and advantages of the invention will become apparent from the following detailed description, taken in conjunction with the accompanying drawings, illustrating by way of example the principles of the invention.